home *** CD-ROM | disk | FTP | other *** search
/ 2,000 Greater & Lesser Mysteries / 2,000 Greater and Lesser Mysteries.iso / menu / batch.doc < prev    next >
Encoding:
Text File  |  1994-06-10  |  3.2 KB  |  59 lines

  1. BATCH     (c) Ray Smith 1987
  2.  
  3. Description:  BATCH is a routine designed to significantly enhance and extend 
  4.               the range of options available to programmers writing .BAT 
  5.               programs under MS-Dos.  In just 239 bytes, it offers facilities 
  6.               such as:     User interuptable loops
  7.                            PAUSE with optional defined ECHO
  8.                            BEEP facility
  9.                            1 to 10 Second user interuptable delays
  10.                            YES/NO reply from user       )Results from these
  11.                            Function Key reply from user )routines are given
  12.                            ASCII reply from user        )in ERRORLEVEL. 
  13.    
  14.              The program requires MS-Dos version 2.0 or greater, and this is
  15.              is checked on entry, with a suitable error message if necesary.
  16.  
  17. Syntax:      BATCH/s[m]  where s = switch A,B,F,K,Y,1,2,3,4,5,6,7,8,9,0
  18.                          [m] is an optional message to be echoed to screen
  19.  
  20. Options:     /a[m]       Halts program execution until a key is pressed
  21.                          The ASCII value of the key pressed is returned in
  22.                          ERRORLEVEL
  23.                          [m] is the optional message which will be echoed 
  24.                          to the screen
  25.  
  26.              /b[m]       Emits a beep from the loudspeaker
  27.                          [m] is the optional message which will be echoed 
  28.                          to the screen
  29.  
  30.              /f[m]       Halts program execution until a function key is 
  31.                          pressed and returns a value in ERRORLEVEL of 1 to
  32.                          10 corresponding to the function key pressed.
  33.                          [m] is the optional message which will be echoed 
  34.                          to the screen
  35.                          WARNING.  If function keys have been redefined using
  36.                          PROMPT the outcome from this option is unpredictable
  37.  
  38.              /k          Examines keyboard status and returns ERRORLEVEL = 0
  39.                          if no key has been pressed, and ERRORLEVEL = 1 if a
  40.                          key has been pressed.  Program execution is not 
  41.                          halted so by calling the routine and then examining
  42.                          ERRORLEVEL the program can check if the user wishes
  43.                          to interupt.
  44.  
  45.              /y[m]       Halts program execution until either Y or N key is 
  46.                          pressed.  The result ERRORLEVEL = 0 is returned if
  47.                          N is pressed, ERRORLEVEL = 1 if Y is pressed.  The
  48.                          caps lock or shift status is not important.
  49.                          [m] is the optional message which will be echoed 
  50.                          to the screen
  51.  
  52.              /N          Where N is a digit from 1 to 9 or 0, causes the 
  53.                          program to pause for N seconds.  /0 causes a pause
  54.                          of 10 seconds.  The user can interupt the pause by
  55.                          pressing any key.  ERRORLEVEL is set to 0 if the
  56.                          routine 'times out' and set to 1 if the user 
  57.                          interupted.
  58.  
  59.